package router

import (
	"gin-skeleton/app/controller/api"
	"gin-skeleton/core/middleware"
	"github.com/gin-gonic/gin"
)

func InitApiRouter(r *gin.Engine) {

	// 设置中间件
	r.Use(middleware.LogTraceIdMiddleware())

	// Api
	v1 := r.Group("/api/v1")
	{
		v1.GET("/index", api.Home{}.Index)

		v1.POST("/index", api.Home{}.Store)

		v1.PUT("/index", api.Home{}.Update)

	}
}
